package com.yr.ryjk.pay.dao;

import java.util.Date;
import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.yr.ryjk.pay.entity.CashIn;
import com.yr.ryjk.pay.vo.CashInUserVO;

public interface CashInMapper {
    int deleteByPrimaryKey(String id);

    int insert(CashIn record);

    int insertSelective(CashIn record);

    CashIn selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(CashIn record);

    int updateByPrimaryKey(CashIn record);

    @Update("update cash_in set status=1 where tn=#{0}")
	void updateStatusByTn(String tn);

	@Select("select * from cash_in where tn=#{0}")
	@ResultMap("BaseResultMap")
	CashIn selectByTn(String tn);

	@Select("select * from cash_in where order_no=#{0}")
	@ResultMap("BaseResultMap")
	CashIn selectByOrderNo(String orderId);

	@Update("update cash_in set status=1 where order_no=#{0}")
	void updateStatusByOrderId(String orderId);

	List<CashInUserVO> selectCashInOfPageAndUser(int start, int pageSize,
			@Param("inTime")Date inTime, @Param("name")String name, @Param("phone")String phone);

	int selectCountAndUser(@Param("inTime")Date inTime, @Param("name")String name, @Param("phone")String phone);

	List<CashIn> selectCashInByUserId(int start, int pageSize,
			@Param("userId")String userId);

	int selectCountByUserId(@Param("userId")String userId);
	
	List<CashInUserVO> selectVoByUserId(@Param("userId")String userId);
}